import request from '@/utils/request'

// 支付单开始
export function getPayments(query) {
  return request({
    url: '/finance/payment/',
    method: 'GET',
    params: query
  })
}

export function addPayment(orderInfo) {
  return request({
    url: '/finance/payment/',
    method: 'POST',
    data: orderInfo
  })
}

export function updatePayment(orderInfo) {
  return request({
    url: `/finance/payment/${orderInfo.id}/`,
    method: 'PATCH',
    data: orderInfo
  })
}

export function delPayment(order_id) {
  return request({
    url: `/finance/payment/${order_id}/`,
    method: 'DELETE',
  })
}

// 支付单结束
// 支付明细

export function getPaymentDetails(query) {
  return request({
    url: '/finance/payment_detail/',
    method: 'GET',
    params: query
  })
}

export function getPaymentDetailByID(detail_id) {
  return request({
    url: `/finance/payment_detail/${detail_id}/`,
    method: 'GET',
  })
}
// 支付明细结束